package com.spddr.pmos.cxf;

import java.util.List;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;

import com.spddr.pmos.domain.TreeLevel;
import com.spddr.pmos.jpa.TradeResultDetail;

import cn.seqdata.cxf.repos.JaxrsRepository;

@Path("/traderesultdetail")
public interface JaxrsTradeResultDetail extends  JaxrsRepository<TradeResultDetail, Long>  {
	
	@GET
	@Path("/all")
	List<TradeResultDetail> findAll(@QueryParam("id") long id,@QueryParam("level") TreeLevel level,@QueryParam("date") String date);
	
	@PUT
	@Path("/")
	default <S extends TradeResultDetail> S save(S entity) {
		return getRepository().save(entity);
	}
	
	@DELETE
	@Path("/{id}")
	default void delete(@PathParam("id") Long id) {
		getRepository().delete(id);
	}
	
	@GET
	@Path("/getContractPlantByCon")
	String getContractPlantByCon(@QueryParam("orgPlant") long orgPlant,@QueryParam("month") String month);
	
	@PUT
	@Path("saveList/{data}")
	void saveList(@PathParam("data") String data);
	
}
